<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Vue2的例子</title>
</head>

<body>
    <div id="app">
        <h1 @click="add">{{count}} * 2 = {{double}}</h1>
    </div>
    <script src="https://unpkg.com/vue@next"></script>
    <script>
        let App = {
            data() {
                return {
                    count: 1
                }
            },
            methods: {
                add() {
                    this.count++
                }
            },
            computed: {
                double() {
                    return this.count * 2
                }
            }
        }
        Vue.createApp(App).mount('#app')
    </script>
</body>

</html>